﻿using System;
using System.Diagnostics;

namespace LisenceUtils
{
    [AttributeUsage(AttributeTargets.Property)]
    public class ShowInLicenseInfoAttribute : Attribute
    {
        public enum FormatType
        {
            String,
            DateTime,
            EnumDescription
        }

        public ShowInLicenseInfoAttribute()
        {
        }

        public ShowInLicenseInfoAttribute(bool showInLicenseInfo)
        {
            if (showInLicenseInfo)
            {
                return;
            }
            ShowInLicenseInfo = false;
        }

        public ShowInLicenseInfoAttribute(bool showInLicenseInfo, string displayAs)
        {
            ShowInLicenseInfo = showInLicenseInfo;
            DisplayAs = displayAs;
        }

        public ShowInLicenseInfoAttribute(bool showInLicenseInfo, string displayAs, FormatType dataFormatType)
        {
            ShowInLicenseInfo = showInLicenseInfo;
            DisplayAs = displayAs;
            DataFormatType = dataFormatType;
        }

        public bool ShowInLicenseInfo { get; } = true;

        public string DisplayAs { get; } = string.Empty;

        public FormatType DataFormatType { get; } = FormatType.String;
    }
}